package sc.test.spring.prop;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import sc.common.test.TestUtil;

@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class PropertiesTest2 {

	@Value("#{springcoolProperties.owner}")
	public String ownerStr;

	@Value("#{testProperties.tester}")
	public String tester;

	@Value("${tester}")
    public String tester2;

	@Value("#{testProperties['test.moji']}")
	public String moji;

	@Value("#{testProperties}")
	public Object testProperties;

	@Value("#{testProperties['adlfajsldfjaskld']:abcd}")
    public String defaultValue;

	@Test
	public void t1() {
		TestUtil.sp(ownerStr);
		TestUtil.sp(tester);
		TestUtil.sp(tester2);
		TestUtil.sp(moji);
		TestUtil.sp(defaultValue);
	}
}
